package demo7;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

@Component
public class student {
    private String name;

    public student() {
        System.out.println("1:student构造器执行了");
    }

    @Override
    public String toString() {
        return "student{" +
                "name='" + name + '\'' +
                '}';
    }

    public String getName() {
        return name;
    }

    @Value("李四")
    public void setName(String name) {
        System.out.println("2:student的setName方法被调了");
        this.name = name;
    }
}
